package meiju;

import java.util.LinkedList;
import java.util.Scanner;
import java.util.Vector;

// 组合型枚举
public class Test01 {
    static int n;
    static int m;//选m个数
    static LinkedList<Integer> chosen = new LinkedList<>();

    static void calc(int x) {
        if (chosen.size() > m || chosen.size() + (n - x + 1) < m) //剪枝
            return;
        if (x == n + 1) { //选够了m个数输出

            for (int i = 0; i < chosen.size(); i++)
                System.out.print(chosen.get(i) + " ");

            System.out.println("");
            return;
        }
        chosen.add(x);
        calc(x +1);
        chosen.remove((Object)x);
        calc(x +1);
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        calc(1);
    }

}
